﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lottery.MediaData.UI.Control {
    public partial class WZOption : UserControl {
        public WZOption() {
            InitializeComponent();
        }

        public string OptionText {
            get {
                if (rbDZX.Checked) {
                    return "大中小";
                } else {
                    return "首次末";
                }
            }
            set {
                if (value == "首次末") {
                    rbSCM.Checked = true;
                } else {
                    rbDZX.Checked = true;
                }
                if (m_selected != null) {
                    m_selected(this, new EventArgs());
                }
            }
        }

        private EventHandler m_selected;
        public event EventHandler Selected {
            add {
                m_selected += value;
            }
            remove {
                m_selected -= value;
            }
        }

        private void rbSCM_CheckedChanged(object sender, EventArgs e) {
            if (m_selected !=null) {
                m_selected(this, new EventArgs());
            }
        }

        private void rbDZX_CheckedChanged(object sender, EventArgs e) {
            if (m_selected != null) {
                m_selected(this, new EventArgs());
            }
        }
    }
}
